<?php
/**
 * Created by PhpStorm.
 * User: Pico_Dragon
 * Date: 14/12/2014
 * Time: 23:53
 */
include '../../db/dbConnect.php';

?><br>
<div class="userTop w100p"><h2 class="h">Quản lí câu hỏi</h2></div>
<div class="userList w70p left">
    <div class="w100p head">
        <h3 class="h">Danh sách câu hỏi của hệ thống</h3><br>
        <div class="search w60p left ">
            <form id="uSearch">
                <ul class="w100p">
                    <li class="w60p"><input type="text" name="keyword" class="inputSearch w100p" id="keyword" placeholder="Tìm theo nội dung câu hỏi/trả lời..." /> </li>
                    <li><input type="submit" class="btn" value="Tìm kiếm" /></li>
                    <li><label><input type="reset" class="btn" id="resetBtn" value="   " /></label></li>
                </ul>

            </form>
        </div>
        <div class="ctrlbar right w30p">
            <ul>
                <li><button id="add" class="btn icon-add" title="Biên soạn câu hỏi mới">Thêm mới</button></li>
                <li><button id="multi-del" num="0" full="0" class="btn icon-del" title="Chọn các bản ghi để xóa">Xóa nhiều</button></li>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
    <div class="result"> </div>
    <div id="tbList">
    <?php include "questionSearch.php"; ?>
    </div>



</div>
<div class="userDetail" id="questionDetail">

    <div id="loadDetail" class="w100p">
        <?php include "questionDetail.php"?>
    </div>
    <div class="result" id="detail"> </div>
</div>
<script type="text/javascript">
    $("form#uSearch").on('submit',function(e){
        e.preventDefault();
        var data=$(this).serialize();
        if(data){
            $("#tbList").load("web/admin/questionSearch.php?"+data);
            $("#multi-del").attr('full','0');
            $("#multi-del").attr('num','0');
        }
    });
    $("#resetBtn").on('click',function(e){
        $("#tbList").load("web/admin/questionSearch.php");
        $("#multi-del").attr('full','0');
        $("#multi-del").attr('num','0');
    });
    $("#add").bind('click',function(){
        $("#loadDetail").load("web/admin/questionAdd.php").fadeIn();
    })
</script>